package com.wondertek.poms.dao.repo;

import com.wondertek.poms.dao.po.ProductGropMember;
import lombok.Value;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import sun.awt.SunHints;

import java.util.List;

public interface IProductGropMemberDao extends JpaRepository<ProductGropMember,Long> {

    @Transactional
    void deleteByGroupId(Long groupId);

    List<ProductGropMember> findAllByGroupId(Long groupId);

    @Transactional
    void deleteByGroupIdAndAndProductId(Long groupId,String productId);

    @Query(value="select p.product_Id from Product_Grop_Member p where p.group_Id = ?1",nativeQuery=true)
    List<String> getProductIdsByGroupId(Long groupId);

}
